package com.jmz.apt.api.common;

/**
 * Created by fanglexue on 2019/10/25.
 */
public class AptConstant {
    public static final Long TOKEN_EXPIRE=7200000L;//token有效期2小时
    public static final Long REFRESH_TOKEN_EXPIRE=604800L;//refresh token有效期1周
    public static final String EMAIL_VALIDATE_CODE_PREFIX="email_validate_code_prefix:";


    public interface File{
        String UPLOAD_EMPTY_ERROR="上传文件不能为空";
        String UPLOAD_FAILURE="文件上传失败";
    }

    public interface Validation{
        String PHONE_REGEX="^1[34578]\\d{9}$";
        String NUMBER_REGEX="^[0-9]*[1-9][0-9]*$";
        String EMAIL_REGEX="^\\\\w+@(\\\\w+\\\\.){1,2}\\\\w+$";
    }

    public interface Redis{
        //Token key
        String LOGIN_AGENTS="apt:login_agents";
        String AGENT_TOKEN="apt:agent_token";
        String TOKEN_SECRETS="apt:token_secrets";
        String TOKEN_SECRET="apt:token_secret";
        String TOKEN_BLACKLIST="apt:token_blacklist";
        String TOKEN_REFRESH="apt:token_refresh";
        String TOKEN_INVALID="apt:token_invalid";

        //entity
        String ROLE_PREFIX="apt:admin_role:";
        String ADMIN_USER_PREFIX="apt:admin_user:";

    }
}
